package pl.enigmatic.fsm;

public interface Restrictor<S, E, T> {

	boolean canExit(S currentState, T target);

	boolean canEnter(S targetState, T target);

	boolean canExecute(E event, T target);

	boolean isFrozen(T target);

	public class Impl<S, E, T> implements Restrictor<S, E, T> {

		@Override
		public boolean canExit(final S currentState, T target) {
			return true;
		}

		@Override
		public boolean canEnter(final S targetState, T target) {
			return true;
		}

		@Override
		public boolean canExecute(final E event, T target) {
			return true;
		}

		@Override
		public boolean isFrozen(T target) {
			return false;
		}
	}
}
